****** SET DATA AS TIME SERIES ***********
tsset year
** generate variables **
gen lnclaimvalue = log(nfip_realvalue)
gen ChangeInPolicies = D.nfippolicies
gen lnclaims = log(nfipclaims)
gen lnsba = log(sba_realvalue)
gen lndrf = log(drf_realvalue)
gen lndamages = log(damages_realvalue)
gen lagdamages = damages_realvalue[_n-1]
gen laglndamages = log(lagdamages)
gen lagfloods = floods[_n-1]
gen katrina = (year == 2005)
gen yr = (year - 1977)
gen fira94 = (year > 1993)
gen fira94trend = (fira94*yr)
gen fira04 = (year > 2003)
gen fira04trend = (fira04*yr)
gen grant06 = (year > 2005)
gen grant06trend = (grant06*yr)
** Save the dataset with all new variables generated ***
save clean.dta, replace
